package cn.rjzjh.tapestry.busi.model.ca;

// Generated 2014-9-6 10:25:55 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.rjzjh.tapestry.component.constant.list.Gender;

/**
 * CaStaff generated by hbm2java
 */
@Entity
@Table(name = "CA_Staff")
public class CaStaff implements java.io.Serializable {

	private int id;
	private CaOrganization caOrganization;
	private String account;
	private String userName;
	private String password;
	private Gender gender;
	private String phone;
	private String mobile;
	private String email;
	private String isValid;
	private String remark;
	private String minusRole;// 需要排除的角色,用于差异化角色配置,用"|"分隔

	private Set<CaGroupStaff> caGroupStaffs = new HashSet<CaGroupStaff>(0);
	private Set<CaStaffPosition> caStaffPositions = new HashSet<CaStaffPosition>(
			0);

	public CaStaff() {
	}

	public CaStaff(int id) {
		this.id = id;
	}

	public CaStaff(int id, String userName, String password, String isValid) {
		this.id = id;
		this.userName = userName;
		this.password = password;
		this.isValid = isValid;
	}

	public CaStaff(int id, CaOrganization caOrganization, String account,
			String userName, String password, Gender gender, String phone,
			String mobile, String email, String isValid, String remark,
			String minusRole, Set<CaGroupStaff> caGroupStaffs,
			Set<CaStaffPosition> caStaffPositions) {
		this.id = id;
		this.caOrganization = caOrganization;
		this.account = account;
		this.userName = userName;
		this.password = password;
		this.gender = gender;
		this.phone = phone;
		this.mobile = mobile;
		this.email = email;
		this.isValid = isValid;
		this.minusRole = minusRole;
		this.remark = remark;
		this.caGroupStaffs = caGroupStaffs;
		this.caStaffPositions = caStaffPositions;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "orgId")
	public CaOrganization getCaOrganization() {
		return this.caOrganization;
	}

	public void setCaOrganization(CaOrganization caOrganization) {
		this.caOrganization = caOrganization;
	}

	@Column(name = "account", length = 50)
	public String getAccount() {
		return this.account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "userName", nullable = false, length = 50)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "password", nullable = false, length = 50)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Enumerated(EnumType.STRING)
	public Gender getGender() {
		return this.gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	@Column(name = "phone", length = 50)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "mobile", length = 50)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "isValid", nullable = false)
	public String getIsValid() {
		return this.isValid;
	}

	public void setIsValid(String isValid) {
		this.isValid = isValid;
	}

	@Column(name = "remark", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "caStaff")
	public Set<CaGroupStaff> getCaGroupStaffs() {
		return this.caGroupStaffs;
	}

	public void setCaGroupStaffs(Set<CaGroupStaff> caGroupStaffs) {
		this.caGroupStaffs = caGroupStaffs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "caStaff")
	public Set<CaStaffPosition> getCaStaffPositions() {
		return this.caStaffPositions;
	}

	public void setCaStaffPositions(Set<CaStaffPosition> caStaffPositions) {
		this.caStaffPositions = caStaffPositions;
	}

	public String getMinusRole() {
		return minusRole;
	}

	public void setMinusRole(String minusRole) {
		this.minusRole = minusRole;
	}

}
